package com.tbit.uqbike.webmanager.controller.operationsanalysis;

import com.tbit.common.entity.pojo.dto.ReturnBikeMsgLogDTO;
import com.tbit.common.entity.pojo.vo.ParkPointCoreDataVO;
import com.tbit.common.entity.pojo.vo.ReturnBikeMsgLogVO;
import com.tbit.common.entity.view.Result;
import com.tbit.uqbike.service.business.operationsanalysis.ParkPointOAService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 运营分析-站点分析
 *
 * @author <a href="mailto:chen.wutian@tbit.com.cn">BUGTian</a>
 * @since 2025/2/27
 */
@Validated
@RestController
@RequestMapping("/operationsAnalysis/parkPoint")
public class ParkPointOAController {

    @Autowired
    private ParkPointOAService parkPointOAService;

    /**
     * 获取站点分析核心数据
     *
     * @param accountId 区域id
     */
    @GetMapping("/getCoreData")
    public Result<ParkPointCoreDataVO> getCoreData(@NotNull Integer accountId, @NotNull Date startTime, @NotNull Date endTime) {
        return Result.success(parkPointOAService.getCoreData(accountId, startTime, endTime));
    }

    /**
     * 获取还车点
     *
     */
    @GetMapping("/getApplyReturnBikePoint")
    public Result<List<ReturnBikeMsgLogVO>> getApplyReturnBikePoint(ReturnBikeMsgLogDTO returnBikeMsgLogDTO) {
        return Result.success(parkPointOAService.getApplyReturnBikePoint(returnBikeMsgLogDTO));
    }

}
